package org.jeecg.config.oss;

import org.jeecg.common.util.oss.ObsBootUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ObsConfiguration {

    @Value("${jeecg.obs.endpoint}")
    private String endpoint;
    @Value("${jeecg.obs.accessKey}")
    private String accessKeyId;
    @Value("${jeecg.obs.secretKey}")
    private String accessKeySecret;
    @Value("${jeecg.obs.bucketName}")
    private String bucketName;
    @Value("${jeecg.obs.staticDomain}")
    private String staticDomain;

    @Bean
    public void initObsBootConfiguration() {
        ObsBootUtil.setEndPoint(endpoint);
        ObsBootUtil.setAccessKeyId(accessKeyId);
        ObsBootUtil.setAccessKeySecret(accessKeySecret);
        ObsBootUtil.setBucketName(bucketName);
        ObsBootUtil.setStaticDomain(staticDomain);
    }

}
